package com.cm.stock.manager.service;


import com.cm.stock.manager.dao.ArticleFactureDAO;
import com.cm.stock.manager.dto.ArticleFactureDTO;
import com.cm.stock.manager.dto.ArticleDTO;
import com.cm.stock.manager.dto.FactureDTO;

public class ArticleFactureService {
	
	private ArticleFactureDAO articlefactureDAO;
	
	public ArticleFactureDTO saveArticleCommande (FactureDTO facture, ArticleDTO article, int quantite, double prixunitaite){
		return articlefactureDAO.save(new ArticleFactureDTO(facture, article, quantite, prixunitaite));
	}
	
	public ArticleFactureDTO updateArticleFacture (ArticleFactureDTO facture){
		return articlefactureDAO.update(facture);
	}
	
	public void deleteArticleFacture (Integer id) throws Exception{
		articlefactureDAO.deleteOne(id);
	}

	public void setArticlefactureDAO(ArticleFactureDAO articlefactureDAO) {
		this.articlefactureDAO = articlefactureDAO;
	}

}
